package com.aclass.xqx.classscreen.ui;

import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.WindowManager;

import com.aclass.xqx.classscreen.R;

import java.util.LinkedHashMap;

import cn.jzvd.JZVideoPlayer;
import cn.jzvd.JZVideoPlayerStandard;


/**
 * Created by xqx on 2017/11/3.
 * 视频界面
 */

public class VideoActivity extends AppCompatActivity  {
    JZVideoPlayerStandard mJcVideoPlayerStandard;
    private String ijkUri = Environment.getExternalStorageDirectory().getPath()+"/Class/big_buck_bunny.mp4";
    private String Uri = "http://129.1.2.243/hjtgrow/public/file/down/upload_video_2017_11_20171123085227607.avi";
    private String Uri1 = "http://129.1.2.243/hjtgrow/public/file/down/upload_video_2017_11_20171123085219898.3gp";
    private String Uri2 = "http://129.1.2.243/hjtgrow/public/file/down/upload_video_2017_11_20171123085236498.flv";
    private String Uri3 = "http://129.1.2.243/hjtgrow/public/file/down/upload_video_2017_11_20171123114506724.mp4";
    private String Uri4 = "http://129.1.2.243/hjtgrow/public/file/down/upload_video_2017_11_20171123114630836.rmvb";
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSupportActionBar().hide();
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_video);
        Intent intent=getIntent();
        String time=intent.getStringExtra("time");
        mJcVideoPlayerStandard = (JZVideoPlayerStandard) findViewById(R.id.jc_video);
        mJcVideoPlayerStandard.setUp(Uri4
                , JZVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "");
        mJcVideoPlayerStandard.loop = true;
        mJcVideoPlayerStandard.startVideo();
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        JZVideoPlayer.releaseAllVideos();
    }

    @Override
    protected void onPause() {
        super.onPause();
        JZVideoPlayer.releaseAllVideos();
    }
}
